﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 第六次课堂作业
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        public string content;
        private void btn_ok_Click(object sender, EventArgs e)
        {
            string path = Application.StartupPath + "\\data\\" + txtString.Text + ".txt";
            FileInfo f = new FileInfo(path);
            FileStream s = f.Create();
            s.Close();
            StreamWriter sw = new StreamWriter(path, true, Encoding.UTF8);
            sw.Write(content);
            sw.Close();
            MessageBox.Show("创建成功！", "提示");
            this.Close();
        }

        private void btn_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
